class Solution(object):
    def lengthOfLastWord(self, s):
        """
        :type s: str
        :rtype: int
        """
        digits = s.split()
        return len(digits[-1])


if __name__ == '__main__':
    s = Solution()
    print(s.lengthOfLastWord("   fly me   to   the moon  "))
